home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
ACORNUSERS
/
CBSA
/
GAMES
/
ELITE
/
!EliteXtra
/
Elite
/
Notes
/
Module
< prev
next >
Wrap
Text File
|
1991-09-24
|
12KB
|
389 lines
/*****************************************************************************************
M I S S I O N S M O D U L E
|\ /|
/ \ / \
-**** | \ / | ****-
\ \ / /
| \_ _/ |
\ \_ |\/| _/ /
\ \ | | / /
__\_______\|__|/______/___
\______E__L__I__T__E_____/
____________________
\_______ ________/
____| |____
\_ _/
\_ _/
| |
|/\|
**
©1991 Floyd Software
Coding by Warren Burch
All rights reserved
******************************************************************************************/
#include "$.Warren.C.Clib.h.stdio"
#include "$.Warren.C.RISC_OSLib.h.bbc"
#include "$.Warren.C.Clib.h.stdlib"
#include "$.Warren.C.Clib.h.math"
#include "$.Warren.C.Clib.h.kernel"
#include "$.Warren.C.Clib.h.swis"
#include "$.Warren.C.RISC_OSlib.h.os"
#include "$.Warren.Project.Code.h.OBJLib"
#include "$.Warren.Project.Code.h.TraderUtil"
#include "$.Warren.Project.Code.h.Trading"
#include "$.Warren.Project.Code.h.Missions"
extern int Equipment[13];
extern int kills;
extern int Cash;
extern int CurrentSystem_PlanetNumber;
extern int CurrentSystem_GalaxyNumber;
int Mission1=0,Mission2=0,Mission3=0;
_kernel_swi_regs mregs;
typedef enum {Requested=1,
Debriefed=2,
Accomplished1=4,
Accomplished2=8,
Accomplished3=16,
Accomplished4=32,
Done=64} MissionSteps;
void MissionMessageStart(void)
{
SetUpDisplay();
bbc_vduq(17,63);
centre("... INCOMING MESSAGE ...\n");
bbc_vduq(17,20);
Delay();
}
void MissionMessageEnd(void)
{
printf("\n");
Delay();
bbc_vduq(17,63);
centre("... MESSAGE ENDS ...");
}
void Mission1_Request(void)
{
MissionMessageStart();
/*01234567890123456789012345678901234567*/
printf("Commander, good beings are seldom\n");
printf("found in space. TS ComDirect lists you");
printf("as one of this rare breed. We have\n");
printf("need of your altruism in a very\n");
printf("serious matter.\n\n");
printf("Please proceed with haste to GalFam\n");
printf("headquaters at Razaar (Santaari) for\n");
printf("briefing.");
MissionMessageEnd();
Mission1=Mission1 | Requested;
}
void Mission1_Razaar(void)
{
MissionMessageStart();
/*01234567890123456789012345678901234567*/
printf("Thank you for your time commander.\n");
printf("The planet Xeaan is starving and may\n");
printf("die out altogether if commmanders\n");
printf("such as yourself do not help.\n");
printf("As you are aware, Ordima pioneered and");
printf("sell the Genesis capsule. Xeann needs\n");
printf("just one more. Each capsule must land\n");
printf("on the planet, where it will explode\n");
/*01234567890123456789012345678901234567*/
printf("scattering its ProtoMatter.\n\n");
printf("Please proceed to Ordima where\n");
/*01234567890123456789012345678901234567*/
printf("Groigans will give you the capsule.\n");
printf("It takes up little room in your hold.\n\n");
printf("Every moment wasted allows another\n");
printf("child to die, please hurry...\n\nGalFam");
MissionMessageEnd();
Mission1=Mission1 | Debriefed;
}
void Mission1_Ordima(void)
{
MissionMessageStart();
/*01234567890123456789012345678901234567*/
printf("Commander, the capsule payment from\n");
printf("GalFam was insufficient. To make up\n");
printf("the shortfall we have deducted 150cr\n");
printf("from your credits. I am sure GalFam\n");
printf("will recompensate you.\n\n");
printf("Capsules should be jettisoned directly");
printf("to planets from a low altitude to\n");
printf("prevent atmospheric burn-up.\n\n");
printf("Hurry. Our sources indicate that Xeann");
printf("is browning...\n");
MissionMessageEnd();
Mission1=Mission1 | Accomplished1;
Cash-=1500;
if (Cash<0) Cash=0;
}
void Mission1_IdleChatter(void)
{
MissionMessageStart();
switch(rand()%3)
{
case 0: /*01234567890123456789012345678901234567*/
printf("Commander, if you're going to trade\n");
printf("with Xeaan, forget it. It's on its\n");
printf("way out.\n");
break;
case 1: /*01234567890123456789012345678901234567*/
printf("Commander, I hear you're helping out\n");
printf("Xeaan for GalFam. Nice one!\n");
break;
case 2: /*01234567890123456789012345678901234567*/
printf("Slave traders: We are no longer\n");
printf("prepared to accept specimens from\n");
printf("Xeaan.\n");
break;
default: break;
}
MissionMessageEnd();
}
void Mission1_FinalMessage(int MissionState)
{
MissionMessageStart();
switch (MissionState)
{
case -995 :
/*01234567890123456789012345678901234567*/
printf("Commander, the genesis capsule has\n");
printf("been tragically destroyed.\nGalFam\n");
Mission1=88888; /* mission failed */
break;
case -996 :
/*01234567890123456789012345678901234567*/
printf("Well Done Commander!\n");
printf("The jettison went very well, and I am\n");
printf("positive that the inhabitants of that\n");
printf("planet were very pleased.\n");
printf("However, it was the wrong planet!\n\n");
printf("We will not ask for your services in\n");
printf("the future.\n\nGalFam");
Mission1=88888; /* mission failed */
break;
case -997 :
/*01234567890123456789012345678901234567*/
printf("Commander, We appreciate your attempt\n");
printf("to help. Unfortunately the capsule\n");
printf("was jettisoned too high and all the\n");
printf("ProtoMatter burned up before landing.");
printf("\n\nGalFam");
Mission1=88888; /* mission failed */
break;
case -998 :
/*01234567890123456789012345678901234567*/
printf("Commander, You were not facing in\n");
printf("quite the correct direction for the\n");
printf("ProtoMatter to make a neat flight to\n");
printf("land. It was well attempted otherwise\n");
printf("\n\nGalFam");
Mission1=88888; /* mission failed */
break;
case -999 :
/*01234567890123456789012345678901234567*/
printf("Commander, we can't thank you enough.\n");
printf("The execution of that mission was\n");
printf("without fault. Xeaan is a poor planet\n");
printf("and can only offer you 500CR for your\n");
printf("efforts. Your charitable actions will\n");
printf("be a source of inspiration for future\n");
printf("commanders...\n\nThe President of Xeaan.\n");
Cash+=5000;
Mission1=99999; /* mission successful */
break;
}
MissionMessageEnd();
}
void Mission2_Request(void)
{
int G,E,T,X,Y;
char PlanetName[10];
MissionMessageStart();
/*01234567890123456789012345678901234567*/
printf("Commander, We are in urgent need of\n");
printf("your assistance.\n");
printf("GalCop have noticed that you are not\n");
printf("beyond indiscriminate killing. As you\n");
printf("know this is not normally tolerated\n");
printf("but we have need of such qualities.\n");
ReturnAllPlanetDetails(200,PlanetName, &X,&Y, &G,&E,&T);
printf("Zartid, a noted Tri-Alliance member\n");
printf("is running plans to the Thargoids.\n");
printf("These plans are of vital importance to");
printf("the future stability of the GalCo-op.\n");
printf("Take him out! he is at %s.\n",PlanetName);
Mission2=Mission2 | Requested;
MissionMessageEnd();
}
void Mission2_Planet200(void)
{
MissionMessageStart();
/*01234567890123456789012345678901234567*/
printf("Thank you for coming to our aid.\n");
printf("Zartid (mta) now poses an imminent");
printf("threat to us all. He has just left\n");
printf("this station flying out with a Mamba\n");
printf("security convoy. His craft cannot be\n");
printf("mistaken, take care commander.");
printf("'Fear is only in your head.'\n\n");
printf("PS. He knows you're after him and a\n");
printf("source said he commented 'I'll drop\n");
printf("him without shedding a tear'.\n");
Mission2=Mission2 | Debriefed;
MissionMessageEnd();
}
void Mission2_FinalMessage(void)
{
MissionMessageStart();
/*01234567890123456789012345678901234567*/
switch (Mission2)
{
case -998 : /* NEVER CALLED YET */
/*01234567890123456789012345678901234567*/
printf("Zartid (mta) is now able to complete\n");
printf("his mission, the plans have got through");
printf("in the escape capsule. This should have");
printf("been destroyed. YOU HAVE FAILED US.\n");
printf("The future of GalCo-op is now in doubt.");
Mission2=88888;
break;
case -998 : /* NEVER CALLED YET */
/*01234567890123456789012345678901234567*/
printf("Zartid (mta) is now able to complete\n");
printf("his mission. Did you really think he\n");
printf("would remain a slave? The Tri-Alliance\n");
printf("have friends everywhere.");
printf("The future of GalCo-op is now in doubt.");
Mission2=88888;
break;
case -999 :
/*01234567890123456789012345678901234567*/
printf("Congratulations commander, a smoothly\n");
printf("executed mission. Please accept these\n");
printf("yaw boosters as payment. Your manual\n");
printf("contains the usage details.\n");
printf("We have also cleansed your records.\n");
Equipment[YawBoosters]=TRUE;
Trading_LegalStatus(-9999);
Mission2=99999;
break;
default:
break;
}
MissionMessageEnd();
}
bool Mission_Debrief(void)
{
/*************************************/
/* */
/* MISSION1 : GENESIS MISSION */
/* */
/*************************************/
if (kills>50 && Cash>4000 && Mission1==0)
{
Mission1_Request();
return(TRUE);
}
if (CurrentSystem_PlanetNumber==167 && CurrentSystem_GalaxyNumber==0 && Mission1==1)
{
Mission1_Razaar();
return(TRUE);
}
if (CurrentSystem_PlanetNumber==236 && CurrentSystem_GalaxyNumber==0 && Mission1==3)
{
Mission1_Ordima();
return(TRUE);
}
if (Mission1<-995)
{
Mission1_FinalMessage(Mission1);
return(TRUE);
}
if (Mission1==7 && CurrentSystem_PlanetNumber!=80 && CurrentSystem_GalaxyNumber==0 && rand()%5==1)
{
Mission1_IdleChatter();
return(TRUE);
}
/*************************************/
/* */
/* MISSION2 : ZARTID III MISSION */
/* */
/*************************************/
/* make sure that they are naughty boys, above 1000 criminal record /*
if (kills>20 && Cash>2000 && LegalStatus>500 && Mission2==0)
{
Mission2_Request();
return(TRUE);
}
if (CurrentSystem_PlanetNumber==200 && Mission2==1)
{
Mission2_Planet200();
return(TRUE);
}
if (Mission2<-997)
{
Mission2_FinalMessage();
return(TRUE);
}
return(FALSE);
}